package com.wh.work;

import com.rabbitmq.client.Channel;
import com.wh.utils.ConnectionUtil;

import java.io.IOException;
import java.util.concurrent.TimeoutException;

/**
 * @Auther: HuiEr
 * @Date: 2020/3/11 20:34
 * @Description
 */
public class Producer {
    private static final String QUEUE_NAME="work-queue";

    public static void main(String[] args) throws IOException, TimeoutException {
        Channel channel = ConnectionUtil.getConnection().createChannel();
        channel.queueDeclare(QUEUE_NAME,false,false,false,null);
        for (int i=0;i<100;i++){
            channel.basicPublish("",QUEUE_NAME,null,("work模型发送的消息    "+i).getBytes());
        }
    }
}
